From 012a1dc35c69cb51ff15b21f8303787b5299a626 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Sat, 12 Sep 2026 10:58:39 +0200 Subject: improve projects layout on mobile --- src/routes/projects/[id]/+page.svelte | 135 ++++++---------------------------- 1 file changed, 22 insertions(+), 113 deletions(-) (limited to 'src/routes/projects/[id]/+page.svelte') diff --git a/src/routes/projects/[id]/+page.svelte b/src/routes/projects/[id]/+page.svelte index 9931f40..8a3561b 100644 --- a/src/routes/projects/[id]/+page.svelte +++ b/src/routes/projects/[id]/+page.svelte @@ -15,12 +15,8 @@ let name = $state(''); let frequency = $state(''); - let editingId = $state(null); - let editName = $state(''); - let editFrequency = $state(''); const frequencyDays = $derived(parseIntervalToDays(frequency)); - const editFrequencyDays = $derived(parseIntervalToDays(editFrequency)); let showArchived = $state(false); let archiveFilter = $state(''); @@ -36,12 +32,6 @@ (a, b) => b.overdueRatio - a.overdueRatio || a.name.localeCompare(b.name), ); } - - function startEdit(routine: RoutineState) { - editingId = routine.id; - editName = routine.name; - editFrequency = `${routine.frequencyDays}d`; - }
@@ -113,94 +103,30 @@
    {#each sorted(data.routines) as routine (routine.id)}
  • - {#if editingId === routine.id} -
    { - return async ({ result, update }) => { - if (result.type === 'failure') { - // Keep the edit form open so the error is visible. - await update({ reset: false }); - return; - } - editingId = null; - await update({ reset: false }); - }; - }} - > - {#if form?.error} -

    {form.error}

    - {/if} - - - + + - -
    - {:else} - -
    - {routine.name} - - {formatFrequency(routine.frequencyDays)} - {#if routine.lastDoneAt} - · fait le {formatDayMonth(routine.lastDoneAt)} - {:else} - · jamais fait - {/if} - -
    -
    - - -
    - + +
    + {routine.name} -
    - - -
    - {/if} + + {formatFrequency(routine.frequencyDays)} + {#if routine.lastDoneAt} + · fait le {formatDayMonth(routine.lastDoneAt)} + {:else} + · jamais fait + {/if} + +
  • {/each}
@@ -303,23 +229,6 @@ color: var(--text-secondary); } - .edit-form { - display: flex; - flex-grow: 1; - gap: 0.5rem; - align-items: center; - flex-wrap: wrap; - } - - .edit-error { - width: 100%; - } - - .edit-form .form-input { - flex: 1; - padding: 0.5rem 0.75rem; - } - .frequency-input { width: 4.5rem; flex-shrink: 0; -- cgit v1.3